<?php

namespace App\Models\Admin;

use Illuminate\Database\Eloquent\Model;

class Rank extends Model
{
    /*
     * @ 使用eloquent create方法能操作的 字段
     */
    protected $fillable = ['rank_thumbnail','rank_number','rank_name','rank_type','rank_status','rank_health_point','rank_prop_id','rank_condition_type','rank_condition'];
    /**
     * 与模型关联的数据表
     */
    protected $table = 'y_ranks';
    /**
     * 与模型关联的数据表的主键
     */
    protected $primaryKey = 'rank_id';

//    public function pictures(){
//        return $this->hasMany('App\Models\Admin\Picture', 'picture_uid', 'picture_id');
//    }

    /**
     * 一个修改器，修改user_status字段的值,实现封号与解封
     */
    public function setRankStatusAttribute($value)
    {
        $this->attributes['rank_status'] = $value;
    }
}
